<#assign menu="order">
<#include "/manage/head.ftl">
<style type="text/css">
.pagination {
    border-radius: 4px;
    display: inline-block;
    margin: 0;
    padding-left: 0;
}
</style>
	<!--main content start-->
	<section id="main-content">
		<section class="wrapper">
        	<!-- page start-->
            <section class="panel">
            	<header class="panel-heading" style="font-size: 18px;">
               		<div class="row">
						<div class="col-lg-8">
							用户订单列表
						</div>
					</div>
                </header>
                <div class="panel-body">
                	<div class="adv-table">
                    	<div role="grid" class="dataTables_wrapper" id="hidden-table-info_wrapper">
                            <table class="table table-striped table-advance table-hover">
                            	<thead>
                                	<tr>
                						<th>用户名</th>
                						<th>收件人</th>
                						<th>下单时间</th>
                						<th>订单价格</th>
                						<th>订单状态</th>
                						<th>地址</th>
                						<th>邮编</th>
                						<th>电话</th>
                						<th>备注</th>
                						<th>操作</th>
              						</tr>
                                </thead>
                            	<tbody role="alert" aria-live="polite" aria-relevant="all">
                            		<#list pageVo.list as order>
                            		<tr class="gradeA odd">
                                    	<td>${order.userName}</td>
                                    	<td>${order.linkman}</td>
                                    	<td>${order.createTime?string("yyyy-MM-dd HH:mm:ss")}</td>
                                    	<td>￥${order.totalprice}</td>
                                    	<td><#if order.status=1>未发货</#if><#if order.status!=1>已发货</#if></td>
                                    	<td>${order.address}</td>
                                    	<td>${order.zipCode}</td>
                                    	<td>${order.mobile}</td>
                                    	<td>${order.remark}</td>
                                    	<td id="attachment">
              								<a href="${BASE_PATH}/manage/user/order/update.htm?orderId=${order.id}" title="修改">
                								修改
                  							</a> | 
                  							<a class="js_send" href="javascript:void(0);"  orderId="${order.id}">
                								发货
                  							</a> |
		                                    <a class="js_delete" href="javascript:void(0);"  orderId="${order.id}">删除</a>
                						</td>
                                	</tr>
                                	</#list>
                               	</tbody>
                              </table>
                              <div style="height: 30px;">
                             	<div class="pagination">${pageVo.pageNumHtml}</div>
                              </div>
                           </div>
                        </div>
                  </div>
              </section>
              <!-- page end-->
          </section>
		</section>
		<!--main content end-->
<script type="text/javascript">
$(function(){
	$('#attachment .js_delete').click(function(){
			var file = $(this);
			bootbox.confirm("是否要删除该订单？", function(result) {
				if (result) {
					$.post("${BASE_PATH}/manage/user/order/delete.json",{'orderId':file.attr("orderId")},function(data){
						if(data.result){
							window.location.reload();
						}
					},"json");
				}
			});		
		});	
		$('#attachment .js_send').click(function(){
			var file = $(this);
			bootbox.confirm("是否要进行发货？", function(result) {
				if (result) {
					$.post("${BASE_PATH}/manage/user/order/send.json",{'orderId':file.attr("orderId")},function(data){
						if(data.result){
							window.location.reload();
						}
					},"json");
				}
			});		
		});	
});
</script>
<#include "/manage/foot.ftl">